<include file="Public/header"/>
<style>
    .gybtn{ position: absolute;right: 40px;}
</style>
<div class="panel panel-default row no-borders">
    <div class="panel-heading" style="background: #fafafa;">
        <h5 class="panel-title text-center"> <i class="fa fa-edit"></i> 修改工艺信息</h5>
    </div>
</div>
<div class="wrapper m-t">
    <div class="panel panel-primary">
        <div class="panel-heading no-padding">
            <div class="panel-options">
                <ul class="nav nav-tabs no-borders">
                    <li><a href="{:U('Orders/orderUpdate?rid='.$rid)}">订单信息</a></li>
                    <li><a href="{:U('Orders/updateProduct?rid='.$rid)}">产品信息</a></li>
                    <li class="active"><a href="{:U('Orders/updateCraft?rid='.$rid)}">工序信息</a></li>
                    <li><a href="{:U('Orders/updateMaterial?rid='.$rid)}">原材料信息</a></li>
                </ul>
            </div>
        </div>
        <div class="panel-body">
            <button class="btn btn-success col-lg-2 m-b" id="gongyi">
                <i class="glyphicon glyphicon-plus"></i> 添加工艺
            </button>
            <div class="clearfix"></div>

            <form  class="form-horizontal" action="{:U('Orders/updateCraft?rid='.$rid)}" method="post">
              <div class="ibox-content" id="gy">

                <volist name="_list" id="vo" key="k">

                <div class="gongyibox">

                    <div class="col-lg-2">
                        <div class="input-group m-b">
                            <span class="input-group-addon bg-info">工序</span>
                            <input type="text" name="processName[]" value="{$vo.processname}" class="form-control" required="required">
                        </div>
                    </div>
                    <div class="col-lg-2">
                        <div class="input-group m-b">
                            <span class="input-group-addon bg-info">工价</span>
                            <input type="text" name="labourCost[]" value="{$vo.labourcost}" class="form-control">
                        </div>
                    </div>
                    <div class="col-lg-2">
                        <div class="input-group m-b">
                            <span class="input-group-addon">操作工</span>
                            <input type="text" name="constructionWorker[]" value="{$vo.constructionworker}" class="form-control">
                        </div>
                    </div>
                    <div class="col-lg-3" id="data_3">
                        <div class="input-group m-b date">
                            <span class="input-group-addon">要求完成时间</span>
                            <input type="text" name="requireTime[]" value="{$vo.requiretime}" class="form-control">
                        </div>
                    </div>

                    <input type="hidden" value="{$vo.pr_id}" name="pr_id[]"/>
                    <div class="col-lg-3">
                        <a class="confirms ajax-get" href="{:U('Orders/gongyidel?pr_id='.$vo['pr_id'])}">
                            <span class="btn btn-info btn-sm"> x </span></a>
                    </div>
                    <div class="clearfix"></div>
                </div>

                </volist>


            </div>
                <div class="form-group">
                    <input type="submit" target-form="form-horizontal" class="ajax-post btn btn-primary col-lg-1 col-lg-push-5 m-t-lg" value="提交"/>
                </div>
            </form>
        </div>
    </div>
</div>

<div id="prs" style="display: none;">
    <div class="gongyibox">

        <div class="col-lg-2">
            <div class="input-group m-b">
                <span class="input-group-addon bg-info">工序</span>
                <input type="text" name="processName[]" class="form-control" required="required">
            </div>
        </div>
        <div class="col-lg-2">
            <div class="input-group m-b">
                <span class="input-group-addon bg-info">工价</span>
                <input type="text" name="labourCost[]" class="form-control">
            </div>
        </div>
        <div class="col-lg-2">
            <div class="input-group m-b">
                <span class="input-group-addon">操作工</span>
                <input type="text" name="constructionWorker[]"  class="form-control">
            </div>
        </div>
        <div class="col-lg-3">
            <div class="input-group m-b date">
                <span class="input-group-addon">要求完成时间</span>
                <input type="text" name="requireTime[]"  class="form-control">
            </div>
        </div>
        <div class="col-lg-3">
            <span class="btn btn-info btn-sm rmove"> x </span>
        </div>
        <div class="clearfix"></div>
    </div>
</div>

<include file="Public/footer"/>
<script src="__PUBLIC__/Admin/js/tianchen.js"></script>
<script src="__PUBLIC__/Admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script>
    var addHtml=$('#prs').html();
    $("#gongyi").click(function () {
        $("#gy").append(addHtml);
    })
    $("body").on('click','.rmove',function () {
        $(this).parents('.gongyibox').remove();
    })


</script>